﻿<%@ Page Title="" Language="C#" MasterPageFile="~/_Default.Master" AutoEventWireup="true" CodeBehind="Resume.aspx.cs" Inherits="WebApplication.Setting.Resume" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%="" %>
    <script>
        let typeTag = null,styleTag = null,identityTag = null;

        let typeTagData=[]
        let styleTagData = []

        <% if (resumeInfo.Tag != null)
        { %>
        const tagData = <%=resumeInfo.Tag%>;
            typeTagData = tagData.splice(0,tagData.indexOf("@"));
            styleTagData = tagData.splice(1, tagData.length);
        <%}%>

        let identityTagData = [];

        <% if (resumeInfo.IdentityTag != null)
        { %>
        identityTagData.push("<%=resumeInfo.IdentityTag%>");
        <% } %>
    </script>
    <link href="../Content/Css/setting.css" rel="stylesheet" />
    <script src="../Content/Scripts/setting.js"></script>
    <link href="../Content/Css/inputTag.css" rel="stylesheet" />
    <script src="../Content/Scripts/ueditor/ueditor.config.js"></script>
    <script src="../Content/Scripts/ueditor/ueditor.all.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="layui-row" style="width: 1200px;">
        <div class="layui-col-md10 layui-col-md-offset1 layui-col-sm10 layui-col-sm-offset1">
            <%--tab--%>
            <div class="layui-tab layui-tab-brief" lay-filter="tabMenu"></div>
            <%--信息更改--%>
            <div class="layui-panel mt-10">
                <div class="layui-row">
                    <div class="layui-col-md10 layui-col-md-offset1 layui-col-sm10 layui-col-sm-offset1">
                        <div class="router-wrapper">
                            <%--简历--%>
                            <div class="custom-form-item flex-container">
                                <div class="label">
                                    简介
                                </div>
                                <div class="value">
                                    <input type="text" value="<%=resumeInfo.Intro %>" maxlength="120" name="intro" lay-verify="intro" autocomplete="off" placeholder="填写接稿相关的介绍，擅长或者想接的稿件类型，自己的优点优势等" />
                                </div>
                            </div>

                            <%--类型标签--%>
                            <div class="custom-form-item flex-container flex-items-start">
                                <div class="label">
                                    类型标签
                                </div>
                                <div class="value">
                                    <div class="layui-row layui-form-item">
                                        <div class="layui-col-sm10 layui-col-md10">
                                            <div class="fairy-tag-container">
                                                <input type="text" class="fairy-tag-input typeTag" autocomplete="off" value="" maxlength="10" />
                                            </div>
                                        </div>
                                        <div class="layui-col-sm2 layui-col-md2">
                                            <div class="text-muted ml-10">*最多3个</div>
                                        </div>
                                    </div>
                                    <div class="flex-container fairy-tag-container border-none">
                                        <div class="flex-grow-1" id="typeTag_id">
                                        </div>
                                    </div>
                                </div>
                            </div>


                             <%--风格标签--%>
                            <div class="custom-form-item flex-container flex-items-start">
                                <div class="label">
                                    风格标签
                                </div>
                                <div class="value">
                                    <div class="layui-row layui-form-item">
                                        <div class="layui-col-sm10 layui-col-md10">
                                            <div class="fairy-tag-container">
                                                <input type="text" class="fairy-tag-input styleTag" autocomplete="off" value="" maxlength="10" />
                                            </div>
                                        </div>
                                        <div class="layui-col-sm2 layui-col-md2">
                                            <div class="text-muted ml-10">*最多3个</div>
                                        </div>
                                    </div>
                                    <div class="flex-container fairy-tag-container border-none">
                                        <div class="flex-grow-1" id="styleTag_id">
                                          
                                        </div>
                                    </div>
                                </div>
                            </div>

                             <%--身份标签--%>
                            <div class="custom-form-item flex-container flex-items-start">
                                <div class="label">
                                    身份标签
                                </div>
                                <div class="value">
                                    <div class="layui-row layui-form-item">
                                        <div class="layui-col-sm10 layui-col-md10">
                                            <div class="fairy-tag-container">
                                                <input type="text" class="fairy-tag-input identityTag" autocomplete="off" value="" maxlength="10" />
                                            </div>
                                        </div>
                                        <div class="layui-col-sm2 layui-col-md2">
                                            <div class="text-muted ml-10">*最多1个</div>
                                        </div>
                                    </div>
                                    <div class="flex-container fairy-tag-container border-none">
                                        <div class="flex-grow-1" id="identityTag_id">
                                           
                                        </div>
                                    </div>
                                </div>
                            </div>

                             <%--接稿经验--%>
                            <div class="custom-form-item flex-container">
                                <div class="label">
                                    接稿经验
                                </div>
                                <div class="value">
                                    <input type="text" value="<%=resumeInfo.Experience %>" maxlength="120" name="experience" lay-verify="experience" autocomplete="off" placeholder="填写之前的接稿经验，最好有项目名+稿件类型" />
                                </div>
                            </div>

                            <%--档期--%>
                            <div class="custom-form-item flex-container">
                                <div class="label">
                                    档期
                                </div>
                                <div class="value">
                                    <input type="text" value="<%=resumeInfo.Schedule %>" maxlength="120" name="schedule" lay-verify="schedule" autocomplete="off" placeholder="填写您的档期" />
                                </div>
                            </div>

                            <%--报价--%>
                            <div class="custom-form-item flex-container">
                                <div class="label">
                                    报价
                                </div>
                                <div class="value">
                                    <input type="text" value="<%=resumeInfo.Quote %>" maxlength="120" name="quote" lay-verify="quote" autocomplete="off" placeholder="可就不同稿件填写对应的价格" />
                                </div>
                            </div>

                            <%--联系方式--%>
                            <div class="custom-form-item flex-container">
                                <div class="label">
                                    联系方式
                                </div>
                                <div class="value">
                                    <input type="text" value="<%=resumeInfo.Contact %>" maxlength="75" name="contact" lay-verify="contact" autocomplete="off" placeholder="站内私信、QQ、微信、邮箱、米画师等" />
                                </div>
                            </div>

                            <div class="form-action">
                                <button type="button" class="layui-btn layui-btn-danger-2" lay-submit="" lay-filter="submit-btn">
                                    <i class="iconfont icon-edit"></i>
                                    &nbsp;保 存
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        layui.use(['form', 'jquery'], function () {
            var $ = layui.jquery,
                form = layui.form,
                layer = layui.layer;

            // 进行登录操作
            form.on('submit(submit-btn)', function (data) {
                
                data = data.field;
                const tags = [...typeTag.options.data, "@", ...styleTag.options.data];
                const identity = identityTag.options.data[0];
                
                $.ajax({
                    url:"/User/Handle.aspx",
                    method:"post",
                    data:{
                        action:"UpdateResumeInfo",
                        tag:JSON.stringify(tags),
                        IdentityTag:identity,
                        ...data
                    },
                    success:(res)=>{
                        layer.alert(res.msg,()=>{
                            location.reload();
                        })
                    }
                })
                return true;
            });
        });
    </script>
</asp:Content>
